<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"  
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
   <body>
        <form action="#" th:action="@{/login}" th:object="${user}" method="post">
            <table>
                <tr>
                    <td>Name:</td>
                    <td><input type="text"  th:field="*{username}"/></td>
                    <td th:if="${#fields.hasErrors('username')}" th:errors="*{username}">Name Error</td>
                </tr>
                <tr>
                    <td>password:</td>
                    <td><input type="text" th:field="*{password}" /></td>
                    <td th:if="${#fields.hasErrors('password')}" th:errors="*{password}">Password Error</td>
                </tr>
                <tr>
                    <td><button type="submit">Submit</button></td>
                </tr>
            </table>
        </form> 
    </body>
</html>